<%@ include file="/includes/includes.jsp" %>
<fieldset class="tablectrl">
    <legend class="padding2p">
        <spring:message code="view.card.permission"/>
    </legend>
    <div><spring:message code="code"/>:&nbsp;<c:out value="${permissionBean.code}"/></div>
    <div><spring:message code="name"/>:&nbsp;<c:out value="${permissionBean.name}"/></div>
    <div><spring:message code="description"/>:&nbsp;<c:out value="${permissionBean.description}"/></div>
    <div>
        <spring:message code='roles'/>:&nbsp;<c:choose>
        <c:when test="${not empty permissionBean.roles}">
            <c:forEach var="role" items="${permissionBean.roles}" varStatus="roleindex">
                <a href="/admin/viewRole.do?roleId=${role.id}"
                   title="<spring:message code='view'/>">
                    <c:out value="${role.name}"/>
                </a>
                <c:if test="${not roleindex.last}"><br></c:if>
            </c:forEach>
        </c:when>
        <c:otherwise><spring:message code="roles.not.defined"/></c:otherwise>
    </c:choose>
    </div>
</fieldset>
<form action="/admin/closePermission.do" method="post">
    <input type="submit" name="close" value="<spring:message code='close'/>" class="margin2p"/>
</form>